package com.mukefile.dao.impl;

import com.mukefile.dao.UploadDao;
import com.mukefile.pojo.ActualFile;
import com.mukefile.pojo.UserFile;
import org.springframework.orm.hibernate5.HibernateTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

/**
 * @author xinke.huang@hand-china.com
 * @version 1.0
 * @date 2021/2/11
 */
@Repository
public class UploadDaoImpl implements UploadDao {
    @Resource
    HibernateTemplate hibernateTemplate;
    @Override
    public void insetFile(ActualFile actualFile, UserFile userFile) {
        hibernateTemplate.save(actualFile);
        userFile.setActualId(actualFile.getId());
        hibernateTemplate.save(userFile);
    }
}
